package com.android.bitmapfun.util;


import android.content.Context;
import android.provider.MediaStore.Images.Thumbnails;

public class LoadImageThumb extends LoadImage{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -2159730470561993590L;

	private final Context mApplication;
	
	private final int mTyle;
	
	private final int mSourceId;
	
	private final String THUMB_FLAG = "luochun_thumb";
	
	/**
	 *    构造方法
	 * @param applicationContext
	 * @param type  类型
	 * @param sourceId  图片在相册里的索引
	 * @param maxWidth  最大宽度
	 * @param maxHeight  最大高度
	 */
	public LoadImageThumb(Context applicationContext,int type,int sourceId,int maxWidth,int maxHeight){
		super(maxWidth, maxHeight, true, false);
		this.mApplication = applicationContext.getApplicationContext();
		this.mTyle = type;
		this.mSourceId = sourceId;
	}
	
	public Context getApplication() {
		return mApplication;
	}

	public int getTyle() {
		return mTyle;
	}

	public int getSourceId() {
		return mSourceId;
	}
	
	@Override
	public String getSourceCacheKey() {
		return THUMB_FLAG+mSourceId+mTyle+MAX_HEIGHT+MAX_WIDTH;
	}

	@Override
	public boolean isComplete() {
		if((mTyle == Thumbnails.MICRO_KIND || mTyle== Thumbnails.MINI_KIND)){
			return true;
		}
		return false;
	}

	@Override
	public String getCacheKey() {
		return THUMB_FLAG+mSourceId+mTyle+MAX_HEIGHT+MAX_WIDTH;
	}
	
}
